<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>属性</title>
    <script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
    <style>
        .class1{
            background-color: aqua;
            color: white;
        }
    </style>
</head>
<body>
<div id="case2-demo5">
    <label>修改颜色</label><input type="checkbox" v-model="use">
    <br>
    <div v-bind:class="{class1:use}">
        v-bind:class 指令
    </div>
</div>
<script type="text/javascript">
    var case2Demo=new Vue({
        el:"#case2-demo5",
        data:{
            use:false
        }
    })
</script>
</body>
</html>